home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue28 / calcomp / CALCOMP.ZIP / CBUILDER.ZIP / MONEYCAL.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-13  |  4.3 KB  |  129 lines

  1. //----------------------------------------------------------------------------
  2. // Moneycal.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: Moneycal.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef MoneycalHPP
  6. #define MoneycalHPP
  7. //----------------------------------------------------------------------------
  8. #include <ExtCtrls.hpp>
  9. #include <StdCtrls.hpp>
  10. #include <Dialogs.hpp>
  11. #include <Forms.hpp>
  12. #include <Controls.hpp>
  13. #include <Graphics.hpp>
  14. #include <Classes.hpp>
  15. #include <Messages.hpp>
  16. #include <Windows.hpp>
  17. #include <SysUtils.hpp>
  18. #include <System.hpp>
  19. namespace Moneycal
  20. {
  21. //-- type declarations -------------------------------------------------------
  22. typedef SmallString<2>  TDayStr;
  23.  
  24. typedef SmallString<3>  TMonthStr;
  25.  
  26. typedef TDayStr TDayArray[14];
  27.  
  28. typedef TMonthStr TMonthArray[12];
  29.  
  30. class __declspec(delphiclass) TCalForm;
  31. class __declspec(pascalimplementation) TCalForm : public Forms::TForm
  32. {
  33.     typedef Forms::TForm inherited;
  34.     
  35. __published:
  36.     void __fastcall FormCreate(System::TObject* Sender);
  37.     void __fastcall FormShow(System::TObject* Sender);
  38.     void __fastcall FormClose(System::TObject* Sender, Forms::TCloseAction &Action);
  39.     void __fastcall FormMouseMove(System::TObject* Sender, Classes::TShiftState Shift, int X, int Y);
  40.     void __fastcall FormMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
  41.         Shift, int X, int Y);
  42.     void __fastcall FormMouseUp(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState 
  43.         Shift, int X, int Y);
  44.     void __fastcall FormPaint(System::TObject* Sender);
  45.     void __fastcall FormKeyPress(System::TObject* Sender, char &Key);
  46.     void __fastcall FormKeyDown(System::TObject* Sender, Word &Key, Classes::TShiftState Shift);
  47.     
  48. private:
  49.     int xoffset;
  50.     int yoffset;
  51.     TDayStr days[14];
  52.     TMonthStr months[12];
  53.     System::TDateTime seldate;
  54.     System::TDateTime thedate;
  55.     System::TDateTime initdate;
  56.     Word startday;
  57.     int frstday;
  58.     int frstmonth;
  59.     Word dx;
  60.     Word dy;
  61.     Word lblx1;
  62.     Word lblx2;
  63.     int xposin;
  64.     int yposin;
  65.     bool flgl;
  66.     bool flgr;
  67.     bool flgla;
  68.     bool daymode;
  69.     System::SmallString<12>  labels;
  70.     Graphics::TColor txtcolor;
  71.     Graphics::TColor txtselcolor;
  72.     Graphics::TColor txtinvcolor;
  73.     Graphics::TColor txtwkndcolor;
  74.     void __fastcall SetLabel(Word mo, Word ye);
  75.     void __fastcall ChangeMonth(int dx);
  76.     void __fastcall ChangeYear(int dx);
  77.     Word __fastcall DaysInMonth(Word mo, Word ye);
  78.     int __fastcall DateToWeek(Word da, Word mo, Word ye);
  79.     void __fastcall PaintArrowLeft(void);
  80.     void __fastcall PaintArrowRight(void);
  81.     void __fastcall PaintLabel(void);
  82.     void __fastcall PaintProc(void);
  83.     void __fastcall ToggleDayMode(void);
  84.     
  85. public:
  86.     __fastcall virtual TCalForm(Classes::TComponent* AOwner);
  87.     void __fastcall SetDate(Word da, Word mo, Word ye);
  88.     void __fastcall GetDate(Word &da, Word &mo, Word &ye);
  89.     void __fastcall SetStartDay(Word aday);
  90.     void __fastcall SetColors(Graphics::TColor textcolor, Graphics::TColor selectcolor, Graphics::TColor 
  91.         inverscolor, Graphics::TColor weekendcolor);
  92.     void __fastcall SetNameofDays(const TDayStr * d);
  93.     void __fastcall SetNameofMonths(const TMonthStr * m);
  94.     void __fastcall SetWeeks(bool onoff);
  95.     void __fastcall SetStarts(int d, int m);
  96.     
  97. protected:
  98.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  99. public:
  100.     /* TForm.CreateNew */ __fastcall TCalForm(Classes::TComponent* AOwner, int Dummy) : Forms::TForm(AOwner
  101.         , Dummy) { }
  102.     /* TForm.Destroy */ __fastcall virtual ~TCalForm(void) { }
  103.     
  104. public:
  105.     /* TWinControl.CreateParented */ __fastcall TCalForm(HWND ParentWindow) : Forms::TForm(ParentWindow
  106.         ) { }
  107.     
  108. };
  109.  
  110. //-- var, const, procedure ---------------------------------------------------
  111. extern Word adaysinmonth[13];
  112. extern System::SmallString<5>  monames[12];
  113. #define selstr "Select month"
  114. #define labelx (Byte)(30)
  115. #define labelw (Byte)(65)
  116. extern TCalForm* CalForm;
  117. //-- template instantiations -------------------------------------------------
  118. template class SmallString<5> ;
  119. template class SmallString<12> ;
  120. template class SmallString<3> ;
  121. template class SmallString<2> ;
  122.  
  123. }    /* namespace Moneycal */
  124. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  125. using namespace Moneycal;
  126. #endif
  127. //-- end unit ----------------------------------------------------------------
  128. #endif    // Moneycal
  129.